/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufscar.compiladores.ast;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Vector;

/**
 *
 * @author takeshi
 */
public class ParamList {
    
    private Collection<Parameter> parameters;
    
    public ParamList() {
        parameters = new ArrayList<Parameter>();
    }

    public void addElement(Parameter parameter) {
        parameters.add(parameter);
    }

    public int getSize() {
        return parameters.size();
    }

    public Enumeration elements() {
        //return parameters.elements();
        return null;
    }

    public void genC(PW pw) {
        int size = parameters.size();
        for (Parameter p : parameters){
            pw.out.print(p.getType().getCname() + " " + p.getName());
            if (--size > 0) {
                pw.out.print(", ");
            }
        }
    }

    public Iterable<Parameter> getList() {
        return parameters;
    }
    
}
